###readme.txt

This folder contains the all Tables and Figures in original analysis included in
Chapter 5 of:
    Enos, Ryan D. 2017. The Space Between Us:
        Social Geography and Politics

Updated: December 5, 2017

***To replicate these files*** run "Chapter5Master.r" by typing
"source('Chapter5Master.r')" into the R terminal. This will use pre-processed
data to output tables and figures in the book and appendix. It does so by calling
the subordinate files: "TableA23FiguresA2A3_5_6.r", "TableA24.r" and
"TableA25.r".

**Prior to executing the scripts, the R terminal should be pointed to the
directory in which the replication files are located, which can be accomplished
by typing "setwd('..')" where ".." is the local file structure where the replication
files are located.

These files require the R programming language, which can be downloaded here: http://www.r-project.org/

You execute replication_master.r, you may need to install the packages used,
this can be accomplished by typing the following in the R terminal:
install.packages('apsrtable'); install.packages('ggplot2');
install.packages('scales')

Questions? Please contact Ryan Enos (renos@gov.harvard.edu).

************************************************************** ***

There are three .csv files associated with each of these scripts. Descriptions
of the csv and variables included are below:

***TableA23FigureA2A3_5_6_data.csv***

creates output for Tables A23 and Figures A2 and A3 in the Appendix and
Figure 5.6 in the book.

Variables:

"trump.shift": county-level percentage point shift of two-party vote share from
Romney in 2012 to Trump in 2016

"romney.shift": county-level percentage point shift of two-party vote share from
McCain in 2008 to Romney in 2012

"mccain.shift": county-level percentage point shift of two-party vote share from
Bush in 2004 to McCain in 2008

"hisp.pct.change.2000.2006": county-level percent change in Hispanic
population from 2000 to 2006

"hisp.pct.change.2000.2014": county-level percent change in Hispanic
population from 2000 to 2014

"ABBAE001": total county population in 2014

"state_abbr": state in which county is located

 "south": Is state in South according to Census region designations



 ***TableA24_data.csv***

creates output for Table A24 in the Appendix.

Variables:

trump.vote": did the subject vote for Trump (0/1)

"hisp.pct.change": county-level percent change in Hispanic population from
2000 to 2014

"male": is the subject male (0/1)

"D20": subject income in ordinal categories

"Quota_Sample_Age": subject age in ordinal categories

"S2": state in which subject lives (numeric code)

"COUNTY": county in which subject lives (numeric code)

"region": Census Region of state in which subject lives



 ***TableA25_data.csv***

creates output for Table A25 in the Appendix.

Variables:

romney.vote": did the subject vote for Romey (0/1)

"hisp.pct.change": county-level percent change in Hispanic population from
2000 to 2014

"male": is the subject male (0/1)

"income.recode": subject income in dollars

"age": subject age in years

"state": state in which subject lives

"COUNTY": county in which subject lives (numeric code)

"region": Census Region of state in which subject lives
